/**
* Copyright (c) 2023 - present TinyVue Authors.
* Copyright (c) 202 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

@import '../custom.less';
@import './vars.less';

@dialog-select-prefix-cls: ~'@{css-prefix}dialog-select';

.@{dialog-select-prefix-cls} {
  .inject-DialogSelect-vars();

  .@{dialog-select-prefix-cls}__body {
    &-search {
      margin-bottom: var(--tv-DialogSelect-search-margin-bottom);
    }

    &-selector {
      .tiny-split-pane {
        &.left-pane {
          padding-right: var(--tv-DialogSelect-split-pane-padding-right-left);
        }
      }

      .tiny-split-trigger-con-simple:hover {
        .tiny-split-trigger {
          background: transparent;
        }
      }

      .tiny-split-trigger-vertical {
        background-color: transparent;
      }
    }

    &-grid {
      border: var(--tv-DialogSelect-body-box-border);
      border-radius: var(--tv-DialogSelect-border-radius);
      overflow: hidden;
    }

    &-tree {
      margin-right: var(--tv-DialogSelect-tree-margin-right);

      .tiny-input-prefix .tiny-input__inner {
        padding-left: var(--tv-DialogSelect-search-input-padding-left);
      }

      .tiny-input__prefix {
        display: inline-flex;
        align-items: center;

        .tiny-svg {
          font-size: var(--tv-DialogSelect-icon-size);
        }
      }

      &-wrapper {
        margin-top: var(--tv-DialogSelect-tree-wrapper-margin-top);
        border: var(--tv-DialogSelect-body-box-border);
        border-radius: var(--tv-DialogSelect-border-radius);
        padding: var(--tv-DialogSelect-tree-wrapper-padding);

        > div {
          height: 100%;
          overflow: auto;

          .tiny-tree {
            padding: 0;
          }
        }
      }
    }

    &-box {
      border: var(--tv-DialogSelect-body-box-border);
      border-radius: var(--tv-DialogSelect-border-radius);
      margin-left: var(--tv-DialogSelect-box-margin-left);
      overflow: hidden;
    }
  }

  .@{dialog-select-prefix-cls}__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;

    &-pager {
      .tiny-pager {
        padding: 0;

        &__btn-prev {
          margin-left: 0;
        }
      }
    }
  }

  .tiny-split-trigger-con-vertical.tiny-split-trigger-con-simple {
    padding: var(--tv-DialogSelect-split-trigger-padding);
  }

  .tiny-split-wrapper {
    box-shadow: none;
    border: none;
    border-radius: 0;
  }

  &.radio-check {
    .tiny-split-trigger-con-vertical.tiny-split-trigger-con-simple {
      display: none;
    }

    .tiny-dialog-select__body-tree {
      margin-right: 0;
    }

    .@{dialog-select-prefix-cls}__body-grid {
      border: none;
      border-radius: 0;
      overflow: auto;
    }
  }

  &.is-tree {
    .tiny-split-pane {
      &.left-pane {
        padding-right: 0;
      }

      &.right-pane {
        .tiny-dialog-select__body-box {
          margin-left: 0;
        }
      }
    }
  }
}
